<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">

<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
  <style type="text/css">
      #view{}
      #view{} .imgbox{float:left;position:relative;width:100px;height: 100px;margin-left: 10px;margin-top: 10px;
      padding:5px;border:solid 1px red;border-radius: 5px;;}
      #view{} .imgbox .close{border: solid 1px red;position: absolute;top: -15px;
      width: 20px;height: 20px; display: inherit;cursor: pointer;text-align: center;background: red;color: #fff;right: -10px;z-index: 20;border-radius: 100%;}
      #view{} .imgbox input{width:100%;height: 100%;z-index: 10;}
    </style>
    <script src="js/toolUtil.js" type="text/javascript"></script>

<title>添加用户</title>
</head>
<body>
<div class="pd-20">
  <form action="/baby/sys/addUser" method="post" enctype="multipart/form-data" class="form form-horizontal" id="form">
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>用户名：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" value="" placeholder="" id="member-name" name="username" datatype="*2-16" nullmsg="用户名不能为空">
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>手机：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" value="" placeholder="" id="member-tel" name="phone"  datatype="m" nullmsg="手机号不能为空">
      </div>
      <div class="col-4"> </div>
    </div>
   <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>密码：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" value="" placeholder="" id="member-tel" name="password"  datatype="m" nullmsg="密码">
      </div>
      <div class="col-4"> </div>
    </div>

    <div class="row cl">
      <label class="form-label col-3">头像：</label>
      <input type="file" name="file" id="file" datatype="*" onchange="load(this)" nullmsg="请添加头像！" />
        请选择jpg,png, jpeg类型的图片
         <div id="view"></div> 
    </div>
    <div class="row cl">
      <label class="form-label col-3">是否设置为管理员：</label>
      <input type="checkbox" name="type" id="type"  />
         <div id="view"></div> 
    </div>
      <div class="col-4"> </div>
    </div>
    
    <div class="row cl">
      <div class="col-9 col-offset-3">
        <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
      </div>
    </div>
  </form>
</div>
</div>
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="lib/layer/1.9.3/layer.js"></script>
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script>
<script src="js/jquery-form.js" type="text/javascript"></script>
<script src="js/toolUtil.js" type="text/javascript"></script>

<script type="text/javascript">

  
$(function(){
$(document).ready(function(){

        $('#form').ajaxForm(function(data){
         //弹出ajax请求后的回调结果，data回调数据  onclick="sub()"
            if(data.code =="2000" ){ 
             alert(data.message); 
             //setCookie("username",data.data.userName);
             window.location.href='member-list.html'
            // window.location.reload();   
         }else if(data.code =="5001" ){
            alert(data.message); 
           window.parent.location.href='http://localhost:8080/baby/resource/admin/login.html'
                
             }  
        });

});



	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-member-add").Validform({
		tiptype:2,
	});


});
</script>
</body>
</html>